package com.mashuai.utils.toolkit.core.msConverts;

import lombok.Data;

import java.io.Serializable;

/**
 * @ClassName: MsHttpResult
 * @Description:
 */
@Data
public class MsHttpResult implements Serializable {

    private Object data;
    private Integer code;
    private String msg;

    public MsHttpResult() {
    }

    public MsHttpResult(Object data, Integer code, String msg) {
        this.data = data;
        this.code = code;
        this.msg = msg;
    }

    public static MsHttpResult success(Object data) {
        return new MsHttpResult(data, 200, null);
    }

    public static MsHttpResult success(Object data, String msg) {
        return new MsHttpResult(data, 200, msg);
    }

    public static MsHttpResult error(String msg) {
        return new MsHttpResult(null, 500, msg);
    }

}
